
package jogs.core; 

import java.util.*;

public class Helpers
{
  public static Random RNG = new Random(); 

  public static void fatalError(Exception e)
  {
    e.printStackTrace(); 
    System.exit(-1); 
  }
  
  public static void fatalError(String msg)
  {
    System.out.println(msg);
    System.exit(-1); 
  }

  public static String genKeyPass(int chars)
  {
    String keypass = ""; 

    for (int i = 0; i < chars; i++)
      keypass += (char)(RNG.nextInt(42)+48); 

    return keypass;     
  }

  public static String chomp(String s)
  {
    return s.substring(0, s.length() - 1); 
  }

}

